tests: Add parsing test from the css spec
authorBenjamin Otte <otte@redhat.com>
Thu, 14 Apr 2011 15:44:31 +0000 (17:44 +0200)
committerBenjamin Otte <otte@redhat.com>
Wed, 18 May 2011 20:17:55 +0000 (22:17 +0200)
tests/css/parser/Makefile.am
tests/css/parser/css-21-malformed-declarations.css [new file with mode: 0644]
tests/css/parser/css-21-malformed-declarations.errors [new file with mode: 0644]
tests/css/parser/css-21-malformed-declarations.ref.css [new file with mode: 0644]

index 62f739fac5570824ad447b8f4edc7bc65b9ff6ae..75cc6ccbda88885d81c610dce8d305b7b3ef16a9 100644 (file)
@@ -34,6 +34,9 @@ EXTRA_DIST += \
        close-at-end-of-file.css \
        close-at-end-of-file.errors \
        close-at-end-of-file.ref.css \
+       css-21-malformed-declarations.css \
+       css-21-malformed-declarations.errors \
+       css-21-malformed-declarations.ref.css \
        declarations.css \
        declarations.errors \
        declarations.ref.css \
diff --git a/tests/css/parser/css-21-malformed-declarations.css b/tests/css/parser/css-21-malformed-declarations.css
new file mode 100644 (file)
index 0000000..7ea0cc6
--- /dev/null
@@ -0,0 +1,7 @@
+p { color:green }
+p { color:green; color }  /* malformed declaration missing ':', value */
+p { color:red;   color; color:green }  /* same with expected recovery */
+p { color:green; color: } /* malformed declaration missing value */
+p { color:red;   color:; color:green } /* same with expected recovery */
+p { color:green; color{;color:maroon} } /* unexpected tokens { } */
+p { color:red;   color{;color:maroon}; color:green } /* same with recovery */
diff --git a/tests/css/parser/css-21-malformed-declarations.errors b/tests/css/parser/css-21-malformed-declarations.errors
new file mode 100644 (file)
index 0000000..abff163
--- /dev/null
@@ -0,0 +1,6 @@
+css-21-malformed-declarations.css:2: error: GTK_CSS_PROVIDER_ERROR_SYNTAX
+css-21-malformed-declarations.css:3: error: GTK_CSS_PROVIDER_ERROR_SYNTAX
+css-21-malformed-declarations.css:4: error: GTK_CSS_PROVIDER_ERROR_SYNTAX
+css-21-malformed-declarations.css:5: error: GTK_CSS_PROVIDER_ERROR_SYNTAX
+css-21-malformed-declarations.css:6: error: GTK_CSS_PROVIDER_ERROR_SYNTAX
+css-21-malformed-declarations.css:7: error: GTK_CSS_PROVIDER_ERROR_SYNTAX
diff --git a/tests/css/parser/css-21-malformed-declarations.ref.css b/tests/css/parser/css-21-malformed-declarations.ref.css
new file mode 100644 (file)
index 0000000..b41216b
--- /dev/null
@@ -0,0 +1,27 @@
+p {
+  color: rgb(0,255,0);
+}
+
+p {
+  color: rgb(0,255,0);
+}
+
+p {
+  color: rgb(0,255,0);
+}
+
+p {
+  color: rgb(0,255,0);
+}
+
+p {
+  color: rgb(0,255,0);
+}
+
+p {
+  color: rgb(0,255,0);
+}
+
+p {
+  color: rgb(0,255,0);
+}